package com.jiruan.invoicemanagementsystem.service.imp;

import com.jiruan.invoicemanagementsystem.dao.IEmailDao;
import com.jiruan.invoicemanagementsystem.dao.Imp.IEmailDaoImp;
import com.jiruan.invoicemanagementsystem.pojo.Email;
import com.jiruan.invoicemanagementsystem.service.IEmailService;
import com.jiruan.invoicemanagementsystem.util.PageHelper;
import com.jiruan.invoicemanagementsystem.vo.InvoicingRecordDetail;

import java.util.ArrayList;

public class IEmailServiceImp implements IEmailService {


    IEmailDao ied=new IEmailDaoImp();

    //新增邮箱信息
    /*
     * 1.邮箱信息
     * 2.是否默认  包含设为默认
     * */
    @Override
    public boolean addNewEmail(String email) {


        return ied.insertNewEmail(email)>0;
    }

//    //设置默认邮箱
    public Integer setDefaultEmail(Email email){
        return ied.updateDefaultEmail(email);
    }

    //根据邮箱id  修改邮箱信息
    public Integer updateEmailById(Email email){
        return ied.updateEmailById(email);
    }


    //查询所有邮箱信息 - (全查)
    @Override
    public ArrayList<Email> queryAllEmail() {

        return ied.selectAllEmail();
    }


    //获取默认邮箱
    @Override
    public Email queryDefEmail() {

        return ied.selectDefaultEmail();
    }


    //开发票页面分页获得邮箱
    public ArrayList<Email> queryEmail(PageHelper pageHelper){
        return ied.selectPageAllEmail(pageHelper);
    }

    //获得所有邮箱条数
    public int queryEmailCount(){

        return ied.queryEmailCount();
    }









}
